#{extends 'frame.html' /}
#{set title:'发布任务' /}

#{set 'moreStyles'}
<link rel="stylesheet" media="screen" href="@{'/public/stylesheets/task-publish.css'}" />
<link rel="stylesheet" media="screen" href="@{'/public/stylesheets/tipsy.css'}" />
<link rel="stylesheet" media="screen" href="@{'/public/stylesheets/datePicker.css'}" />
#{/set}

#{if msg}
<div class="contentCard">
	<div class="contentTitle">
		<span class="iconfont">&#xf00b7;</span>
		提示
	</div>
	<div class="contentBody">
		<div class="errBox">
			<div class="panelLine">
				<span>您目前暂时无法发布新任务，原因如下：</span>
			</div>
			<div class="panelLine">
				#{if user.status.toString()=='ACTIVE'}
				<span class="bold">需要先开通VIP会员~~</span>
				<span>
					<a href="/user/member">[立即开通]</a>
				</span>
				#{/if}
				#{elseif user.status.toString()=='INVALID'}
				<span class="bold">您的VIP会员身份已过期~~</span>
				<span>
					<a href="/user/member">[立即续费]</a>
				</span>
				#{/elseif}
				#{else}
				<span class="bold">${msg}~~</span>
				#{/else}
			</div>
		</div>
	</div>
</div>
#{/if}
<form id="addTrafficForm">
	<div class="contentCard stepCard" style="${session.contains('taskId') && !task?.isPaid ?'display:none':''}" id="taskStep-1">
	<div class="contentTitle">
			流量发布
		</div>
		<div class="contentBody">
			<div class="panelLine sec">
				<span class="secondTile floatLeft mr20">选择平台</span>
				<span class="checkTextBtn selectedCtb platform" href="javascript:;" value="TAOBAO">淘宝</span>
				<!-- span class="checkTextBtn  platform" href="javascript:;" value="TMALL">天猫</span>
				<span class="checkTextBtn  platform" href="javascript:;" value="JD">京东</span -->
			</div>
			<div class="panelLine sec">
				<span class="secondTile floatLeft mr20">选择类型</span>
				<span class="checkTextBtn selectedCtb type" href="javascript:;" value="PC">电脑</span>
				<!-- span class="checkTextBtn  type" href="javascript:;" value="MOBILE">手机APP</span -->
				<span>电脑端每个点击花费<span class="red">1</span>流量；手机APP为淘宝客户端点击，内测中，每个点击需<span class="red">3</span>流量</span>
			</div>
			<div class="panelLine sec">
					<span class="ls floatLeft itemUrl">
						商品链接
						<span class="red bold">*</span>
					</span>
					<input type="text" class="inputText floatLeft ls long required" id="txtItemUrl" name="itemUrl" value="" />
			</div>
			
			<div class="legendPanel">
				<div class="l_title">
					<span class="iconfont">&#xf00fd;</span> 搜索关键字方案
				</div>
				<div class="panelLine wordPlan">
					<span class="floatLeft ls"> 关键词 <span class="red bold">*</span>
					</span> <input type="text"
								class="inputText floatLeft ls middle required" name="word" /> <span
								class="floatLeft ls">点击次数</span> <input type="text"
								class="inputText floatLeft clickTime ls short required" name="times" />
								<a href="javascript:;" class="close iconfont" original-title="">&#xf0011;</a>
				</div>
				<div class="panelBox panelBox2" style="margin: 10px 0;"
					id="tmSearchBtnBox">
					<a class="plusBlockBtn" id="tmAddWordPlan" href="javascript:;"
						on="tm"> <i class="iconfont" style="font-size: 20px;">&#xf0154;</i>
						<span>点击多添加1个搜索关键字方案（最多可添加4个方案）</span>
					</a>
				</div>
			</div>
			<div class="panelLine sec">
					<span class="ls floatLeft itemUrl">
						开始时间
						<span class="red bold">*</span>
					</span>
					<input type="text" class="inputText floatLeft ls inputDate  required" id="beginTime" name="beginTime" value="" />
			</div>
			<div class="panelLine sec">
					<span class="ls floatLeft itemUrl">
						结束时间
						<span class="red bold">*</span>
					</span>
			<input type="text" class="inputText floatLeft ls inputDate  required" id="endTime" name="endTime" value="" />
			</div>
			<div class="buttonSection">
				<a href="javascript:;" class="stdColorButton next" id="publishSave">
					发布
				</a>
			</div>
			<div class="panelLine sec">
				<span class="orange">本次任务将花费<span class="red payFlow">0</span>个流量,剩余<span class="red residueFlow">${user.flow}</span>个流量</span>
			</div>
		</div>
	</div>
</form>


<!-- 开通会员后才能发布任务 -->
#{if user.status.toString()=='VALID'}
	#{set 'moreScripts'}
	<script src="@{'/public/javascripts/date.js'}" type="text/javascript"></script>
	<script src="@{'/public/javascripts/jquery.datePicker.js'}" type="text/javascript"></script>
	<script src="@{'/public/javascripts/plupload/plupload.full.min.js'}" type="text/javascript"></script>
	<script src="@{'/public/javascripts/qiniu.min.js'}" type="text/javascript"></script>
	<script src="@{'/public/javascripts/mustache.min.js'}" type="text/javascript"></script>
	<script src="@{'/public/javascripts/jquery.tipsy.js'}" type="text/javascript"></script>
	<script src="@{'/public/javascripts/jquery.number.min.js'}" type="text/javascript"></script>
	<script  type="text/javascript">App.flowNum="${user.flow}"</script>
	<script src="@{'/public/javascripts/task/publishFlow.js'}" type="text/javascript"></script>
	<script type="text/javascript">
		App.module = 'publishFlow';
	</script>
	#{/set}
#{/if}